import IOC.Bean3;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by futao on 2017/8/30.
 */

/**
 * 通过非静态工厂创建
 */
public class TestBean3 {
    @Test
    public void TestBean3() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Bean3 bean3 = (Bean3) applicationContext.getBean("bean3");
        System.out.println(bean3);
        Bean3 b3=(Bean3)applicationContext.getBean("bean3");
        System.out.println(b3);
        bean3.add();
    }
}
